<link rel="stylesheet" href="http://10.202.1.109/workForHTML/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="http://10.202.1.109/workForHTML/js/jquery.ztree.core-3.4.js" type="text/javascript"></script>
<script src="http://10.202.1.109/workForHTML/js/jquery.ztree.excheck-3.4.js" type="text/javascript"></script>
<script src="http://10.202.1.109/workForHTML/js/jquery.ztree.exedit-3.4.js" type="text/javascript"></script>
<script src="http://10.202.1.109/workForyangtzeu/administrator/assets/js/jquery.json.js"></script>

<script type="text/javascript">
	var setting = {
		async : {
			enable : true,
			url : "http://10.202.1.109/workForYangtzeu/administrator/index.php?c=departmentManager&a=ajax_tree",
			autoParam : [ "id=dep_id", "department_id", "name=n", "level=lv" ],
			//	 			otherParam : {
			//	 				"otherParam" : "zTreeAsyncTest"
			//	 			},
			dataFilter : filter
		}
	}
	
	/**
	 *
	 */
	function filter(treeId, parentNode, childNodes) {
		// 		window.console.log("filter(treeId, parentNode, childNodes)");
		// 		window.console.log(arguments);
		if (!childNodes)
			return null;

		if ($.isArray(childNodes)) {
			for ( var i = 0, l = childNodes.length; i < l; i++) {
				childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
			}
		} else {
			if (typeof childNodes.error == undefined) {
				return null;
			} else {
				// 				$.dialog(childNodes.error);
				alert(childNodes.error);
				return null;
			}
		}
		return childNodes;
	}
	
	$(document).ready(function() {
		$.fn.zTree.init($("#dep_tree"), setting);
	});
</script>
<div class="tree">
				<ul id="dep_tree" class="ztree"></ul>
			</div>